home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: alisa.org!wjjr
- From: wjjr@alisa.org (John J. Rushford)
- Subject: Re: Help with writing to stdin (UNIX)
- X-Newsreader: TIN [version 1.2 PL2]
- Organization: My place on the Front Range.
- Message-ID: <Dosnnz.FGy@alisa.org>
- References: <199603210528.TAA02459@ss20.bnkdp.khabarovsk.su>
- Date: Sun, 24 Mar 1996 22:55:11 GMT
-
- Igor Kouznetsov (igor@bnkdp.khabarovsk.su) wrote:
- : I create a child process (by fork()) and need to insert some input to
- : the stdin (sure, stdin is the same for both parent and child
- : processes) in parent, expecting that it will appear in stdin of
- : child.
-
- : I tried to do that,foe example, by direct writing to buffer
- : pointed by according fields of stdin FILE structure, but pointer to
- : buffer associated with stdin turns to be NULL, I can't comprehand
- : why :-(
-
- : I also made some attempts using other methods but they also failed
- : for different reasons, so there's no sense to describe that struggle.
-
- : A small illustration of the task:
- : ---------- ---------
- : | Parent | | Child |
- : | process | | process |
- : -------->|----------|---->| |
- : stdin | ^ | | |
- : | | | | |
- : | some | | |
- : | input | | |
- : --------- ---------
- : Does anybody have any idea how to realize it?
- : Note: I need NOT a pipe between processes but a way to insert
- : something namely to stdin of child process.
-
- You need a pipe. stdin in the parent and child are not the same after the
- fork().
-
- regards
- --
- John J. Rushford
- Westminster, Colorado___/\_/\_
- wjjr@alisa.org (alisa.org is powered by FreeBSD)
-
-